// 接口

export {}; // 确保跟其他示例没有成员冲突

// 接口定义
// interface Post {
//   title: string;
//   content: string;
// }

// function printPost(post: Post) {
//   console.log(post.title);
//   console.log(post.content);
// }
// printPost({ title: '111', content: '2222' });
// ----------
interface Post {
  title: string;
  content: string;
  subtitle?: string; // 可选
  readonly summary: string; // 只读
}
const hello: Post = {
  title: "Hello TypeScript",
  content: "a JavaScript Supperset",
  summary: "a JavaScript",
};

// ------------
interface Cache {
  [prop: string]: string;
}

const cache: Cache = {};
cache.value = "value";
cache.foo = "foo";
